package com.yanfan.energy.domain;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;
import com.yanfan.energy.domain.enums.WorkOrderStatus;

/**
 * @Author huan
 * @Description DispatchList 状态转换
 * @ClassName 2023年01月11日 15:22:00
 * @Version 1.0
 **/
public class DispatchListStateConverter implements Converter<Long> {

    @Override
    public Class<?> supportJavaTypeKey() {
        return Converter.super.supportJavaTypeKey();
    }

    @Override
    public CellDataTypeEnum supportExcelTypeKey() {
        return Converter.super.supportExcelTypeKey();
    }

    @Override
    public WriteCellData<?> convertToExcelData(Long value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception {
        return new WriteCellData<>(WorkOrderStatus.getEnumByType(value));
    }
}
